﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IP.Core.IPData;
using IP.Core.IPUserService;
using BKIDS;
using BKIDS.CDBNames;
using BKIUS;
using IP.Core.IPCommon;
using System.Data;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            load_data_2_combo_ten_du_an();
            load_data_2_grv();
        }
    }

    private void load_data_2_combo_ten_du_an()
    {
        US_DM_DU_AN v_us_du_an = new US_DM_DU_AN();
        DS_DM_DU_AN v_ds_du_an = new DS_DM_DU_AN();

        v_us_du_an.FillDataset(v_ds_du_an);


        m_cbo_chon_du_an.Items.Add(new ListItem("Tất cả", CIPConvert.ToStr(0)));
        for (int v_i = 0; v_i < v_ds_du_an.DM_DU_AN.Rows.Count; v_i++)
        {
            m_cbo_chon_du_an.Items.Add(new ListItem(CIPConvert.ToStr(v_ds_du_an.DM_DU_AN.Rows[v_i][DM_DU_AN.TEN_DU_AN]), CIPConvert.ToStr(v_ds_du_an.DM_DU_AN.Rows[v_i][DM_DU_AN.ID])));
        }

    }
    private void load_data_2_grv()
    {
        US_GD_CONG_VIEC_THANH_VIEN_TIEN_DO_DU_AN v_us = new US_GD_CONG_VIEC_THANH_VIEN_TIEN_DO_DU_AN();
        DS_GD_CONG_VIEC_THANH_VIEN_TIEN_DO_DU_AN v_ds = new DS_GD_CONG_VIEC_THANH_VIEN_TIEN_DO_DU_AN();
        v_us.FillDataset(v_ds);
        m_grv_ds_tv_da.DataSource = v_ds.GD_CONG_VIEC_THANH_VIEN_TIEN_DO_DU_AN;
        m_grv_ds_tv_da.DataBind();
    }
    public string mapping_cong_viec_by_id(object ip_obj_id_cong_viec)
    {
        US_DM_CONG_VIEC_DU_AN v_us_cv_da = new US_DM_CONG_VIEC_DU_AN(CIPConvert.ToDecimal(ip_obj_id_cong_viec));
        return v_us_cv_da.strTEN_CONG_VIEC;
    }
    public string mapping_ma_du_an_by_id(object ip_obj_id_du_an)
    {
        US_DM_DU_AN v_us_da = new US_DM_DU_AN(CIPConvert.ToDecimal(ip_obj_id_du_an));
        return v_us_da.strMA_DU_AN;
    }
    public string mapping_trang_thai_da_by_id(object ip_obj_id_trang_thai_da)
    {
        US_CM_DM_TU_DIEN v_us_tu_dien = new US_CM_DM_TU_DIEN(CIPConvert.ToDecimal(ip_obj_id_trang_thai_da));
        return v_us_tu_dien.strTEN;
    }
}
